﻿// ----------------------------------------------------------------------------------
// Sample Code from Fernando Machado Píriz's blog: http://fernandomachadopiriz.com
//
// <copyright company="Fernando Machado Píriz" file="Contract.cs">
// Copyright (c) Fernando Machado Píriz. Distributed under FSF's GPL v2.</copyright>
// ----------------------------------------------------------------------------------
// This code and information are provided "as is" without warranty of any kind,
// either expressed of implied, including but not limited to the implied warranties
// of merchantability and/or fitness for a particular purpose.
// ----------------------------------------------------------------------------------
namespace GivingAPresentation.Commons
{
    using System.Configuration;
    using System.Windows;
    using System.Windows.Input;

    /// <summary>
    /// The interface all component parts should implement.
    /// </summary>
    public interface IContract
    {
        /// <summary>
        /// Gets the user interface for this component part.
        /// </summary>
        FrameworkElement Element { get; }

        /// <summary>
        /// Gets the command used to notify component parts to apply changes when the user is starting a presentation. This command has no
        /// arguments.
        /// </summary>
        ICommand StartPresentation { get; }

        /// <summary>
        /// Gets the command used notify component parts to undo changes when the user ends giving a presentation. This command has no
        /// arguments.
        /// </summary>
        ICommand StopPresentation { get; }

        /// <summary>
        /// Gets the command used to notify component parts before they are used for the first time. Parts should load previously stored state.
        /// This command receives an <code>ISettingsManager</code> instance as argument.
        /// </summary>
        ICommand InitializePart { get; }

        /// <summary>
        /// Gets the command used notify component parts when they are not needed anymore. Parts should store currently configured state. This
        /// command receives an <code>ISettingsManager</code> instance as argument.
        /// </summary>
        ICommand FinalizePart { get; }
    }

    /// <summary>
    /// The tab in which a component part must appear.
    /// </summary>
    public interface IMetadata
    {
        /// <summary>
        /// Gets the caption of the tab.
        /// </summary>
        string Tab { get; }
    }
}
